type StudentApi = {
  getList: (opts: any) => Promise<any>;
  add: (opts: any) => Promise<any>;
  getDetail: (id: number) => Promise<any>;
  put: (id: number, opts: any) => Promise<any>;
};

export default <StudentApi>{
  // get请求
  // ?scope=generic&pageSize=300&sortField=id&sortOrder=DESC
  add: async (opts: any) => await getFetchData("/student", "post", opts),
  getList: async (opts: any) =>
    await getFetchData("/student/list", "get", opts),
  getDetail: async (id: number) =>
    await getFetchData("/student?id=" + id, "get"),
  put: async (id: number, opts: any) =>
    await getFetchData("/student?id=" + id, "put", opts),
};
